package edu.hit.pact.pgse.crawler.blog;

import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.commons.logging.Log;

public abstract class AbstractBlogThread extends Thread {
	
	protected Log logger;
	protected AtomicBoolean isFinished;
	
	
	public AbstractBlogThread(String threadName,Log logger){
		super(threadName);
		this.logger = logger;
		this.isFinished = new AtomicBoolean(false);
	}
	
	public AbstractBlogThread(Log logger){
		super();
		this.logger = logger;
		this.isFinished = new AtomicBoolean(false);
	}
	
	abstract public void mainRun();
	
	@Override
	public void run(){
		
		logger.info(this.getName() + " begin to work.");
		mainRun();
		logger.info(this.getName() + " finished.");
	}
	
}
